/**
 * Apr 2, 2011
 * 9:37:02 PM
 * Timiz
 * kukujun@gmail.com
 *cn.lastjune.service.impltimiz-project-dpProblemServiceImpl
 */
package cn.lastjune.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.lastjune.dao.ProblemDao;
import cn.lastjune.pojo.Problem;
import cn.lastjune.service.ProblemService;
import cn.lastjune.util.Page;

/**
 * @author Timiz
 *         kukujun@gmail.com
 */
@Service
@Transactional
public class ProblemServiceImpl implements ProblemService
{

    @Autowired
    ProblemDao dao;

    /*
     * (non-Javadoc)
     * @see cn.lastjune.service.ProblemService#getAll(cn.lastjune.util.Page)
     */
    @Override
    public Page<Problem> getAll(Page<Problem> page)
    {
        return dao.getPageAll(page);
    }

    /*
     * (non-Javadoc)
     * @see cn.lastjune.service.ProblemService#getProblemById(java.lang.String)
     */
    @Override
    public Problem getProblemById(String id)
    {
        return dao.getByEventcauseid(id);
    }

    /*
     * (non-Javadoc)
     * @see cn.lastjune.service.ProblemService#insertProblem(cn.lastjune.pojo.Problem)
     */
    @Override
    public void insertProblem(Problem entity)
    {
        dao.add(entity);
    }

    /*
     * (non-Javadoc)
     * @see cn.lastjune.service.ProblemService#deleteProblem(java.lang.String)
     */
    @Override
    public void deleteProblem(String id)
    {
        dao.delete(id);
    }

    /*
     * (non-Javadoc)
     * @see cn.lastjune.service.ProblemService#updateProblem(cn.lastjune.pojo.Problem)
     */
    @Override
    public void updateProblem(Problem entity)
    {
        dao.update(entity);
    }

	@Override
	public List<Problem> getAllFilter(String type,String filter) {
		return dao.getAllByFilter(type,filter);
	}

}
